package com.demdudes.disch.handler;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.input.GestureDetector;

public class InputHandler implements InputProcessor {

	private GestureDetector gestureDetector;
	private GestureHandler gestureHandler;
	private GameStateHandler gameStateHandler;
	
	public InputHandler(GameStateHandler gameStateHandler) {
		this.gestureHandler = new GestureHandler(gameStateHandler);
		this.gestureDetector = new GestureDetector(gestureHandler);
		this.gameStateHandler = gameStateHandler;
	}
	
	@Override
	public boolean keyDown(int keycode) {
		return gestureDetector.keyDown(keycode);
	}

	@Override
	public boolean keyUp(int keycode) {
		return gestureDetector.keyUp(keycode);
	}

	@Override
	public boolean keyTyped(char character) {
		return gestureDetector.keyTyped(character);
	}

	@Override
	public boolean touchDown(int screenX, int screenY, int pointer, int button) {
		Gdx.app.debug("InputHandler", "touchDown");
		return gestureDetector.touchDown(screenX, screenY, pointer, button);
	}

	@Override
	public boolean touchUp(int screenX, int screenY, int pointer, int button) {
		Gdx.app.debug("InputHandler", "touchUp");
		return gestureDetector.touchUp(screenX, screenY, pointer, button);
	}

	@Override
	public boolean touchDragged(int screenX, int screenY, int pointer) {
		return gestureDetector.touchDragged(screenX, screenY, pointer);
	}

	@Override
	public boolean mouseMoved(int screenX, int screenY) {
		return gestureDetector.mouseMoved(screenX, screenY);
	}

	@Override
	public boolean scrolled(int amount) {
		return gestureDetector.scrolled(amount);
	}

}
